package arlpanda.lcmtypes;
 
import java.io.*;
import java.util.*;
 
public final class simplepose_t implements lcm.lcm.LCMEncodable
{
    public long utime;
    public double pos[];
    public double vel[];
    public double orientation;
    public double rotation_rate;
    public double accel[];
 
    public simplepose_t()
    {
        pos = new double[2];
        vel = new double[2];
        accel = new double[2];
    }
 
    public static final long LCM_FINGERPRINT;
    public static final long LCM_FINGERPRINT_BASE = 0x353d65e5da1195daL;
 
    static {
        LCM_FINGERPRINT = _hashRecursive(new ArrayList<Class>());
    }
 
    public static long _hashRecursive(ArrayList<Class> classes)
    {
        if (classes.contains(arlpanda.lcmtypes.simplepose_t.class))
            return 0L;
 
        classes.add(arlpanda.lcmtypes.simplepose_t.class);
        long hash = LCM_FINGERPRINT_BASE
            ;
        classes.remove(classes.size() - 1);
        return (hash<<1) + ((hash>>63)&1);
    }
 
    public void encode(DataOutput outs) throws IOException
    {
        outs.writeLong(LCM_FINGERPRINT);
        _encodeRecursive(outs);
    }
 
    public void _encodeRecursive(DataOutput outs) throws IOException
    {
        byte[] __strbuf = null;
        outs.writeLong(this.utime); 
 
        for (int a = 0; a < 2; a++) {
            outs.writeDouble(this.pos[a]); 
        }
 
        for (int a = 0; a < 2; a++) {
            outs.writeDouble(this.vel[a]); 
        }
 
        outs.writeDouble(this.orientation); 
 
        outs.writeDouble(this.rotation_rate); 
 
        for (int a = 0; a < 2; a++) {
            outs.writeDouble(this.accel[a]); 
        }
 
    }
 
    public simplepose_t(byte[] data) throws IOException
    {
        this(new DataInputStream(new ByteArrayInputStream(data)));
    }
 
    public simplepose_t(DataInput ins) throws IOException
    {
        if (ins.readLong() != LCM_FINGERPRINT)
            throw new IOException("LCM Decode error: bad fingerprint");
 
        _decodeRecursive(ins);
    }
 
    public static arlpanda.lcmtypes.simplepose_t _decodeRecursiveFactory(DataInput ins) throws IOException
    {
        arlpanda.lcmtypes.simplepose_t o = new arlpanda.lcmtypes.simplepose_t();
        o._decodeRecursive(ins);
        return o;
    }
 
    public void _decodeRecursive(DataInput ins) throws IOException
    {
        byte[] __strbuf = null;
        this.utime = ins.readLong();
 
        this.pos = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            this.pos[a] = ins.readDouble();
        }
 
        this.vel = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            this.vel[a] = ins.readDouble();
        }
 
        this.orientation = ins.readDouble();
 
        this.rotation_rate = ins.readDouble();
 
        this.accel = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            this.accel[a] = ins.readDouble();
        }
 
    }
 
    public arlpanda.lcmtypes.simplepose_t copy()
    {
        arlpanda.lcmtypes.simplepose_t outobj = new arlpanda.lcmtypes.simplepose_t();
        outobj.utime = this.utime;
 
        outobj.pos = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            outobj.pos[a] = this.pos[a];
        }
 
        outobj.vel = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            outobj.vel[a] = this.vel[a];
        }
 
        outobj.orientation = this.orientation;
 
        outobj.rotation_rate = this.rotation_rate;
 
        outobj.accel = new double[(int) 2];
        for (int a = 0; a < 2; a++) {
            outobj.accel[a] = this.accel[a];
        }
 
        return outobj;
    }
 
}

